home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-imglld.adb < prev    next >
Text File  |  1996-01-30  |  3KB  |  74 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       S Y S T E M . I M G _ L L D                        --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.2 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Img_Decimal; use System.Img_Decimal;
  27. with System.Img_LLI;     use System.Img_LLI;
  28.  
  29. package body System.Img_LLD is
  30.  
  31.    -----------------------------
  32.    -- Image_Long_Long_Decimal --
  33.    -----------------------------
  34.  
  35.    function Image_Long_Long_Decimal
  36.      (V     : Long_Long_Integer;
  37.       S     : access String;
  38.       Scale : Integer)
  39.       return  Natural
  40.    is
  41.       P : Natural := 0;
  42.  
  43.    begin
  44.       Set_Image_Long_Long_Decimal
  45.         (V, S.all, P, Scale, 2, Integer'Max (1, Scale), 0);
  46.       return P;
  47.    end Image_Long_Long_Decimal;
  48.  
  49.    ---------------------------------
  50.    -- Set_Image_Long_Long_Decimal --
  51.    ---------------------------------
  52.  
  53.    procedure Set_Image_Long_Long_Decimal
  54.      (V     : Long_Long_Integer;
  55.       S     : out String;
  56.       P     : in out Natural;
  57.       Scale : Integer;
  58.       Fore  : Natural;
  59.       Aft   : Natural;
  60.       Exp   : Natural)
  61.    is
  62.       Digs : aliased String (1 .. Long_Long_Integer'Width);
  63.       --  Sign and digits of decimal value
  64.  
  65.       D : Natural;
  66.       --  Number of characters in Digs buffer
  67.  
  68.    begin
  69.       D := Image_Long_Long_Integer (V, Digs'Access);
  70.       Set_Decimal_Digits (Digs, D, S, P, Scale, Fore, Aft, Exp);
  71.    end Set_Image_Long_Long_Decimal;
  72.  
  73. end System.Img_LLD;
  74.